package com.grad.why.studentsystem.mapper;

import com.grad.why.studentsystem.domain.Student;
import com.grad.why.studentsystem.domain.StudentExample;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface StudentMapper {
    int countByExample(StudentExample example);

    int deleteByExample(StudentExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Student record);

    int insertSelective(Student record);

    List<Student> selectByExample(StudentExample example);

    Student selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByExample(@Param("record") Student record, @Param("example") StudentExample example);

    int updateByPrimaryKeySelective(Student record);

    int updateByPrimaryKey(Student record);

    ArrayList<Student> getStudentList(@Param("offset") int offset,@Param("limit") int limit,@Param("sort") String sort,@Param("search") String search);

    long getStudentListLength(@Param("search") String search);

//    void addNations(@Param("nationName") String nationName);

    int getMaxId();

    List<Student> getStudentListByClassinfoId(@Param("id") int id);


    List<Student> getStudentsInfoByClassId(@Param("id") Integer id);

    int insertStudentlll(@Param("username") String username);
}